<div class="widget">
	<div class="widget-header bg-blue">
		<i class="widget-icon icon-notebook"></i> 
		<span class="widget-caption"> 签到/请假历史 </span>
		<div class="widget-buttons">
			<a href="javascript:void(0);" onclick="handlerCancel(this);" title="关闭"
				 data-toggle="dispose" data-refresh-table="#table-contract"> <i class="fa fa-times"></i> </a> 
		</div>
	</div>
		
		<div class="widget radius-bordered mgbt-xs-10" id="editor-panel-checkHistory">
			<div class="widget-body editor-body-sm">
				<table data-ajax="handlerSearch" 
				 	 data-id-field="id" 
							 data-unique-id="id" 
							 data-pagination="true"  
							 data-check-on-init="true" 
							 data-side-pagination="server" 
							 data-mobile-responsive="true"
				 	 data-form-search="#search-form-checkHistory" id="table-checkHistory">
					<thead>
					<tr>
						<th data-field="createDate" 	data-align="center" data-formatter="renderCreateDate" >上课时间</th>
						<th data-field="classes" 			data-align="center">班级名称</th>
						<th data-field="status" 			data-align="center" data-formatter="renderStatus" >状态</th>
						<th data-field="actor" 				data-align="center">操作人</th>
						<th data-field="actorDate" 		data-align="center" data-formatter="renderactorDate">操作时间</th>
					</tr>
					</thead>
				</table>
			</div>
		</div>
		
</div>

<!-- 提交表单 ========================================================= -->
<!-- 提交表单 ========================================================= -->
<form id="search-form-checkHistory" action="/miwawa/{dbname}/common/search.json" method="post" 
			name="com.app.miwawa.api.eam.entity.view.StudentHistory">
			<input type="hidden" name="invalid" value="F" data-search-group="and" data-search-operation="EQ">
			<input type="hidden" name="contractId" value="" data-search-group="and" data-search-operation="EQ">
			<input type="hidden" data-search-sort="createDate" data-search-order="asc">
</form>

<script type="text/javascript">
<!--
	require(['domReady'],function(domReady){
		domReady(function () {
			jQuery("#search-form-buyinfo").data("template-id","#view-buyinfo-template");
			jQuery("#search-form-payinfo").data("template-id","#view-payinfo-template");

			initData();
		});
	});
	
	var contract;
	function initData(){
		contract = jQuery("#table-contract").data("selectedRow");
		jQuery(":hidden[name='contractId'],[data-foreign-id]").val(contract.id);
				
		jQuery("#table-checkHistory").bootstrapTable({
			onLoadSuccess:function(data){
				require(['jquery.plugin.form'],function(form){
					form.datepicker(".date-selector");
					form.tooltip("[data-toggle='tooltip']");
				});
			}
		});
	}
	
	function renderCreateDate(value, row, index){
		var time = row.classes.toString();
		var date = time.substring(0,7);
	 	return value+" "+date;
	}
	
	function renderStatus(value, row, index){
		return value == "缺席" ? "缺勤": value ;
	}

	function renderactorDate(value, row ,index){
		var actorTime = value.toString();
		var actorDate = actorTime.substring(0,19);
		return actorDate;
	}
//-->
</script>